new Vue({
    el: '#app',
    props: {
        
        isEdit: {
          type: Boolean,
          default: false
        }
      },
    data: function () {
        return {
            hasEditCreated:false,
            visible: false,
            isCollapse: false,
            opened: false,
            isActive: false,
            selectProductCateValue: [],
            productCateOptions:[{ label: "猫", value: 1, children: null }, { label: "狗", value: 2, children: null }, { label: "鱼", value: 3, children: null }, { label: "鸟", value: 4, children: null }, { label: "爬行类", value: 5, children: null }],
            value:{
                name: '',
                productCategory: '',
                description: '',
                price: '',
                stock: '',
            },
            brandOptions: [],
            rules: {
              name: [
                {required: true, message: '请输入商品名称', trigger: 'blur'},
                {min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
              ],
              productCategoryId: [{required: true, message: '请选择商品分类', trigger: 'blur'}],
              description: [{required: true, message: '请输入商品介绍', trigger: 'blur'}],
              requiredProp: [{required: true, message: '该项为必填项', trigger: 'blur'}]
            }
          };
    },
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
        sidebarHide(){
            $(".sidebar-container").addClass("sidebar-hide");
            alert("sidebarHide");
        },
        sidebarOpen(){
            $(".sidebar-container").removeClass("sidebar-hide");
            alert("sidebarOpen");
        },
        toggleSideBar(){
            alert("togglesidebar");
        },
        sideBar(){
            alert("sidebar");
        },
        toggleClick(){
            this.isActive = !this.isActive;
            this.isCollapse=!this.isCollapse;
        },
        handleCommand() {
            window.location.href="/home";
        },
        logout(){

        },
        addProduct(){
            
        },
    }
})